package com.shimba.recording.universalinterface;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.shimba.recording.universalinterface.bean.UserBean;
import com.shimba.recording.universalinterface.nblinterface.FunctionHasParamHasResult;
import com.shimba.recording.universalinterface.nblinterface.FunctionManager;

/**
 * Created by Administrator on 2019/1/10.
 */

public class FragmentTow extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_tow, null);

        (view.findViewById(R.id.tv_tow)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                FunctionManager.getInstance().addFunction(new FunctionHasParamHasResult<UserBean, UserBean>("hasParamHasResult") {
                    @Override
                    public UserBean function(UserBean o) {
                        Log.e("===> ", "传过来的User对象" + o.toString());
                        return new UserBean("杨晨", "123456");
                    }
                });
            }
        });
        return view;
    }
}
